package com.month.ai.tools;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Function;

/**
 * 模型调用工具
 */
@Configuration
public class FunctionTools {

    private static final Logger logger = LoggerFactory.getLogger(FunctionTools.class);

    public record AddOperationRequest(int d1, int d2) {

    }


    @Bean
    @Description("加法运算")
    public Function<AddOperationRequest, Integer> test(){
        return request -> {
            logger.info("加法运算函数被调用了:" + request.d1 + "," + request.d2 );
            return request.d1() + request.d2();
        };
    }

}
